package fons.model.ontology.language;

import java.util.Set;

import com.google.common.collect.Sets;

import fons.model.ontology.Dimension;

public abstract class Modifier extends AbstractNamed implements Comparable<Modifier> {
	private final int priority;
	public static final int EXPANDER = 0;
	public static final int REDUCER = 1;
	
	
	public Modifier(String name) {
		this(name, 0);
	}
	
	public Modifier(String name, int priority) {
		super(name);
		this.priority = priority;
	}
	
	public int getPriority() {
		return priority;
	}
	
	@Override
	public int compareTo(Modifier o) {
		if (priority < o.priority) return -1;
		else if (priority > o.priority) return 1;
		else return 0;
	}
		
	public abstract Set<Dimension> modify (Set<Dimension> dimensions, ModifierSentenceElement element);
	public abstract void selectElements(Sentence sentence, ModifierSentenceElement element);
		
	public Set<Dimension> getDimensions(ModifierSentenceElement element) {
		return Sets.newHashSet();
	}
}
